import Vue from 'vue'
import Vuex from 'vuex'
// import user from '@/store/modules/user'
// import cart from "@/store/modules/cart"
// 手动导入

// 自动导入
let files = require.context("./modules",false,/\.js$/);
let modules = {}
files.keys().forEach(filename=>{
  let moduleName = filename.replace(/(\.\/|\.js)/g,"")
  modules[moduleName] = files(filename).default
})
// console.log(modules);
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
  },
  getters: {
  },
  mutations: {
  },
  actions: {
  },
  modules
  // modules: {
  //   user, cart
  // }
})
